package dk.au.cs.peterbn.spoonprocessing;

import spoon.processing.Builder;
import spoon.support.DefaultCoreFactory;
import spoon.support.builder.MySpoonBuildingManager;

/**
* Created by IntelliJ IDEA.
* User: peter
* Date: 11/9/11
* Time: 11:35 AM
* To change this template use File | Settings | File Templates.
*/
public class Factory extends spoon.reflect.Factory {
    private SpoonLauncher spoonLauncher;
    private String cp;

    public Factory(SpoonLauncher spoonLauncher, CollectingEnvironment env, String cp) {
        super(new DefaultCoreFactory(), env);
        this.spoonLauncher = spoonLauncher;
        this.cp = cp;
    }

    @Override
    public Builder getBuilder() {
        if (this.builder == null)
            this.builder = new MySpoonBuildingManager(this, cp);
        return this.builder;
    }

}
